{# Copyright The IETF Trust 2015-2024, All Rights Reserved #}
{% load origin %}
{% origin %}
{% load ietf_filters proceedings_filters managed_groups %}
{% load tz %}
<tr>
    <td>
        {% if entry.name %}
            <div id="{{ entry.name|slugify }}">{{ entry.name }}</div>
        {% else %}
            <div id="{{ entry.group.acronym }}">
                <a href="{% url 'ietf.group.views.group_home' acronym=entry.group.acronym %}">{{ entry.group.acronym }}</a>
            </div>
            {% if entry.group.state.slug == "bof" %}
                <span class="badge rounded-pill text-bg-success">{{ entry.group.state.slug|upper }}</span>
            {% endif %}
        {% endif %}
    </td>
    {% if entry.canceled %}
        <td colspan="{% if user|has_role:'Secretariat' or user_groups %}6{% else %}5{% endif %}">
            <span class="badge rounded-pill text-bg-danger">Session cancelled</span>
        </td>
    {% else %}
        <td>
            {% for agenda in entry.agendas %}
                {% if entry.agendas|length == 1 and agenda.time > old %}
                    <i class="small bi bi-bell"
                       title="Last Update: {{ agenda.time|utc|date:"Y-m-d H:i:s" }} UTC"></i>
                {% endif %}
                <a href="{{ agenda.material|meeting_href:meeting }}">
                    Agenda {% if agenda.time %}{{agenda.time|date:"D G:i"}}{% endif %}
                </a>
                <br>
            {% empty %}
                {% if show_agenda == "True" %}<span class="badge rounded-pill text-bg-warning">No agenda</span>{% endif %}
            {% endfor %}
        </td>
        <td>
            {% for minutes in entry.minutes %}
                <a href="{{ minutes.material|meeting_href:meeting }}">
                    Minutes {% if minutes.time %}{{minutes.time|date:"D G:i"}}{% endif %}
                </a>
                <br>
            {% empty %}
                {% if show_agenda == "True" %}<span class="badge rounded-pill text-bg-warning">No minutes</span>{% endif %}
            {% endfor %}
            {% if entry.session.type_id == 'regular' and show_agenda == "True" %}
                {% for attendance in entry.attendances %}
                    {% with session=attendance.material %}
                        <a href="{% url 'ietf.meeting.views.session_attendance' session_id=session.pk num=session.meeting.number %}">
                            Attendance
                            {% if attendance.time %}{{ attendance.time|date:"D G:i" }}{% endif %}
                        </a>
                    {% endwith %}
                    <br>
                {% endfor %}
            {% endif %}
        </td>
        <td>
                {% for slide in entry.slides %}
                    {% if slide.time > old %}
                        <i class="small bi bi-bell"
                              title="Last Update: {{ slide.time|utc|date:"Y-m-d H:i:s" }} UTC"></i>
                    {% endif %}
                    <a href="{{ slide.material|meeting_href:meeting }}">{{ slide.material.title|clean_whitespace }}</a>
                    <br>
                {% empty %}
                    <span class="badge rounded-pill text-bg-warning">No slides</span>
                {% endfor %}
        </td>
        <td>
                {% for draft in entry.drafts %}
                    {% if draft.time > old %}
                        <i class="small bi bi-bell"
                              title="Last Update: {{ draft.time|utc|date:"Y-m-d H:i:s" }} UTC"></i>
                    {% endif %}
                    <a href="{% url "ietf.doc.views_doc.document_main" name=draft.material.name %}">
                        {{ draft.material.name }}
                    </a>
                    <br>
                {% empty %}
                    <span class="badge rounded-pill text-bg-warning">No Internet-Drafts</span>
                {% endfor %}
        </td>
        <td>
            {% if entry.last_update %}
                {{ entry.last_update|utc|date:"Y-m-d" }}
                <br>
                <small class="text-body-secondary">{{ entry.last_update|utc|date:"H:i:s" }}&nbsp;UTC</small>
            {% endif %}
        </td>
        {% if user|has_role:"Secretariat" or user_groups %}
            <td>
                {% if user|has_role:"Secretariat" or entry.group in user_groups %}
                    <div class="float-end">{% include "meeting/edit_materials_button.html" with session=entry.session only %}</div>
                {% endif %}
            </td>
        {% endif %}
    {% endif %}
</tr>
